/*
 * randomtestcard.c
 * CS362 Assignment 3
 * Hugh McDonald (mcdonalh)
 */
#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(int argc, char *argv[]) {
	int cards[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, steward, great_hall, cutpurse};
	struct gameState *testGame = newGame();

	initializeGame(2, cards, -1, testGame);

	SelectStream(2);
	PutSeed(3);

	int num, i, player;
	for (num = 0; num < 5000; num++) {
		for (i = 0; i < sizeof(struct gameState); i++) {
			((char*)testGame)[i] = floor(Random() * 256);
		}
		
		player = floor(Random() * 2); 
		testGame->deckCount[player] = floor(Random() * MAX_DECK);
		testGame->discardCount[player] = floor(Random() * MAX_DECK);
		testGame->handCount[player] = floor(Random() * MAX_HAND);

		testGame->hand[player][0] = steward;
		cardEffect(steward, 0, 0, 0, testGame, 1, 0);

		printf("pass: %d\n", num);
	}

	printf("Done!");
	return 0;
}